/**
 * 乘最多水的容器
 * LeetCode 11
 */

public class test5 {

    public int maxArea(int[] height) {
        int ans = 0;
        for(int l = 0 , r = height.length-1; l<r;){
            ans = Math.max(ans, Math.min(height[l], height[r]) * (r-l));
            if(height[l] <= height[r]) {
                l++;
            }else{
                r--;
            }

        }
        return ans;
    }

}
